]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Don't wait until the dialog is loaded before opening it
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 5 Mar 2013 06:51:28 +0000 (01:51 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 11 Mar 2013 19:08:21 +0000 (15:08 -0400)
If we wait asynchronously, key presses while the shield is opening
will be dropped in the void.

https://bugzilla.gnome.org/show_bug.cgi?id=686740

js/gdm/loginDialog.js
js/ui/screenShield.js
js/ui/unlockDialog.js

index b1ee384628698cc08aabd0a5f13f9f85c8062523..e9cb99fcfa143c16754214a774de61e084c23f41 100644 (file)
@@ -1014,7 +1014,7 @@ const LoginDialog = new Lang.Class({
                      function() {
                          // If we're just starting out, start on the right
                          // item.
-                         if (!this.is_loaded) {
+                         if (!this._userManager.is_loaded) {
                              this._userList.jumpToItem(this._timedLoginItem);
                          }
                      },
@@ -1152,15 +1152,6 @@ const LoginDialog = new Lang.Class({
                                   Lang.bind(this, function(userManager, user) {
                                       this._userList.removeUser(user);
                                   }));
-
-        // emitted in idle so caller doesn't have to explicitly check if
-        // it's loaded immediately after construction
-        // (since there's no way the caller could be listening for
-        // 'loaded' yet)
-        Mainloop.idle_add(Lang.bind(this, function() {
-            this.emit('loaded');
-            this.is_loaded = true;
-        }));
     },
 
     _onOpened: function() {
index 4081219be8c8635812e35b4c136ce558e60e36f2..ada1024e69666c7497eecdd37d0f53981ca4a2b7 100644 (file)
@@ -892,14 +892,12 @@ const ScreenShield = new Lang.Class({
 
 
             let time = global.get_current_time();
-            this._dialog.connect('loaded', Lang.bind(this, function() {
-                if (!this._dialog.open(time, onPrimary)) {
-                    // This is kind of an impossible error: we're already modal
-                    // by the time we reach this...
-                    log('Could not open login dialog: failed to acquire grab');
-                    this.deactivate(true);
-                }
-            }));
+            if (!this._dialog.open(time, onPrimary)) {
+                // This is kind of an impossible error: we're already modal
+                // by the time we reach this...
+                log('Could not open login dialog: failed to acquire grab');
+                this.deactivate(true);
+            }
 
             this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed));
             this._dialog.connect('unlocked', Lang.bind(this, this._onUnlockSucceded));
index 775cab5ed18fd230d58462e6883d041373b771d2..07cbe4fbca64f572abcb7016e638ae1360735339 100644 (file)
@@ -141,11 +141,6 @@ const UnlockDialog = new Lang.Class({
         let batch = new Batch.Hold();
         this._userVerifier.begin(this._userName, batch);
 
-        GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
-            this.emit('loaded');
-            return false;
-        }));
-
         Main.ctrlAltTabManager.addGroup(this.dialogLayout, _("Unlock Window"), 'dialog-password-symbolic');
 
         this._idleMonitor = new GnomeDesktop.IdleMonitor();